With the development of new technologies of network devices, especially for support of programmability and virtualization, the development of network devices trends toward separation of a control plane from a data plane. As one of the technologies, OpenFlow draws widespread attention. An OpenFlow network consists of three parts: an OpenFlow switch, a FlowVisor, and a controller. The OpenFlow switch is a core component of the entire OpenFlow network, and mainly manages forwarding of a data layer. The FlowVisor performs virtualization on the network. The Controller performs centralized control on the network to implement a function of a control layer. After receiving a data packet, the OpenFlow switch first searches a local flow table for a forwarding destination port, and forwards the data packet to the controller if no match is found, and the control layer decides a forwarding port. OpenFlow implements data forwarding on an OpenFlow switch, and implements data forwarding control on a controller, thereby implementing separation of a data forwarding layer from a control layer.
It can be seen from the foregoing process of processing a data packet in an OpenFlow network that, searching a flow table is an important step. Generally, there are more than one local flow tables, and multiple flow tables are cascaded to form a multi-level flow table. Match fields of an existing multi-level flow table are all fixed multi-level flow-table match fields, where each flow table of the multi-level flow table has a fixed match field. Each flow table has an independent search unit. Once a data packet arrives, a search unit searches a flow table corresponding to the data packet, then obtains an ID of a next flow table by means of search, determines the next flow table to be skipped to, and adds an action corresponding to a search result to an instruction set. Flow table skipping may be skipping over a flow table. According to the stipulation in the OpenFlow protocol, each time after matching is performed on a flow table, an ID of a next flow table may be specified, as long as the ID is greater than an ID of a current table. For example, it is specified that a matching result of a flow table 1 is to skip to a flow table 3; therefore, the flow table 1 may skip over a flow table 2 and directly skip to the flow table 3.
A main disadvantage of the foregoing existing multi-level flow table search method lies in lack of flexibility, because each single flow table in a multi-level flow table has a fixed match field, and hardware logic needs to be modified each time a match field is modified.